﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using Vlc.DotNet.Core.Medias;
using Vlc.DotNet.Forms;
using Vlc.DotNet.Core;

namespace PlayerLabano
{
    public partial class Player : UserControl
    {
        public event EventHandler ClosePanelForm;

        public Player()
        {
            // Set libvlc.dll and libvlccore.dll directory path
            VlcContext.LibVlcDllsPath = @"C:\Projets\vlc-1.1.11"; // CommonStrings.LIBVLC_DLLS_PATH_DEFAULT_VALUE_AMD64;

            // Set the vlc plugins directory path
            VlcContext.LibVlcPluginsPath = @"C:\Projets\vlc-1.1.11\pugins"; //CommonStrings.PLUGINS_PATH_DEFAULT_VALUE_AMD64;
            VlcContext.StartupOptions.AddOption("--play-and-pause");

            InitializeComponent();
        }
        public void PlayUrl(string url)
        {
            var media = new PathMedia(url);
            this.vlcControl.Media = media;
            this.vlcControl.Play();
            
        }

      

        private void ColosBtn_Click(object sender, EventArgs e)
        {
            this.vlcControl.Pause();
            ClosePanelForm(sender, e);
        }
    }
}
